<?php
	require_once ("db_connection.php");
	session_start();
	$pic = $_SESSION['varname'];
	$date = date("Y-m-d H:i:s");
	$id = "ve-" . uniqid();
	

	$query = "INSERT INTO vehicles(vehicleid,affiliateid,vehicletype,capacity,vehiclemodel,image)
		VALUES('$id','$_POST[afid]', '$_POST[vvehicletype]','$_POST[vcapacity]', '$_POST[vvehiclemodel]', '$pic')";
	
	if(!mysql_query($query, $con)){
		die('Error: '. mysql_error());
	}
	echo "Saved!";
	
	mysql_close($con);
?>